home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17405 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: ghost.shsu.edu!usenet
  2. From: Gary Frost <grfcon@netropolis.net>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: memcopy...
  5. Date: Mon, 15 Apr 1996 13:38:14 -0500
  6. Organization: G.R.F Contracts U.K Ltd
  7. Message-ID: <31729796.F85@netropolis.net>
  8. References: <4ksiul$n1o@news.duke.edu> <317239A2.41C6@dopey.uibk.ac.at>
  9. NNTP-Posting-Host: 205.241.79.114
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.4 sun4d)
  14.  
  15. Herwig Stecher wrote:
  16. > > Hi...I'm wondering if anyone knows the syntax for the memcopy function
  17. > > (well, I think it's memcopy...it might be something similar to
  18. > > memcopy...it's the function that copies some specified area of memory
  19. > > bitwise into some other area of memory).  This would be very helpful;
  20. > > thanks much.
  21. > >
  22. > The syntax for the memcpy function is:
  23. > #include <string.h>
  24. > memcpy(target,start,size);
  25. > where "start" is a pointer to the adress from where you want to copy
  26. > something to the memory location where "target" points to.
  27. > "size" is the amount of data you want to copy.
  28. > e.g.
  29. >   int *target;
  30. >   int start[10];
  31. >   target = new int[10];
  32. >   memcopy(target, start, sizeof(int)*10);
  33. > will copy the data in the array start.
  34.  
  35. Beware of possible problems with overlapping memory.   Check out memmove() also.
  36.  
  37. Gary
  38.